<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

/*Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});*/

Route::get('testapi/index', 'TestApiController@index');//测试接口
Route::post('testapi/index', 'TestApiController@index');//测试接口

Route::get('wechat/api', 'WechatController@api');//开发者模式校验
Route::post('wechat/api', 'WechatController@api');//接收微信事件

Route::post('login/wx_login', 'LoginController@wx_login');//微信网页授权登录

Route::post('home/wx_user_status', 'HomeController@wx_user_status');//用户状态
Route::post('home/send_short_msg', 'HomeController@send_short_msg');//短信发送
Route::post('home/check_short_msg', 'HomeController@check_short_msg');//短信校验
Route::post('home/create_user_info', 'HomeController@create_user_info');//创建用户资料

Route::get('admin/wx_menu', 'AdminController@wx_menu');//设置微信自定义菜单

// 微信服务器校验测试
Route::any('wechat/server', 'WechatController@server');
Route::get('wechat/login', 'LoginController@wxLogin');

// 发送验证码
Route::post('captcha', 'CaptchaController@store');

Route::group(['middleware' => 'auth:api'], function () {
    Route::post('bind_mobile', 'LoginController@bindMobile');
});
